import React, {Component} from 'react';
import PropTypes from 'prop-types';

export default class TextButton extends Component {
    static propTypes = {
        children: PropTypes.string,
        name: PropTypes.oneOfType([
            PropTypes.number,
            PropTypes.string
        ]),
        onClick: PropTypes.func
    }

    onClick = () => {
        this.props.onClick(this.props.name);
    }

    render() {
        return (
            <a onClick={this.onClick}>
                {this.props.children}
            </a>
        );
    }
}
